/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mundial;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author jorge
 */
@Entity
@Table(name = "ranking_fifa", catalog = "equipo", schema = "")
@NamedQueries({
    @NamedQuery(name = "RankingFifa.findAll", query = "SELECT r FROM RankingFifa r"),
    @NamedQuery(name = "RankingFifa.findById", query = "SELECT r FROM RankingFifa r WHERE r.id = :id"),
    @NamedQuery(name = "RankingFifa.findByRanking", query = "SELECT r FROM RankingFifa r WHERE r.ranking = :ranking"),
    @NamedQuery(name = "RankingFifa.findByGrupo", query = "SELECT r FROM RankingFifa r WHERE r.grupo = :grupo"),
    @NamedQuery(name = "RankingFifa.findByCopas", query = "SELECT r FROM RankingFifa r WHERE r.copas = :copas"),
    @NamedQuery(name = "RankingFifa.findByPartido3", query = "SELECT r FROM RankingFifa r WHERE r.partido3 = :partido3"),
    @NamedQuery(name = "RankingFifa.findByPartido2", query = "SELECT r FROM RankingFifa r WHERE r.partido2 = :partido2"),
    @NamedQuery(name = "RankingFifa.findByPartido1", query = "SELECT r FROM RankingFifa r WHERE r.partido1 = :partido1"),
    @NamedQuery(name = "RankingFifa.findByNombre", query = "SELECT r FROM RankingFifa r WHERE r.nombre = :nombre")})
public class RankingFifa implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "ranking")
    private String ranking;
    @Basic(optional = false)
    @Column(name = "grupo")
    private String grupo;
    @Basic(optional = false)
    @Column(name = "copas")
    private String copas;
    @Basic(optional = false)
    @Column(name = "partido3")
    private String partido3;
    @Basic(optional = false)
    @Column(name = "partido2")
    private String partido2;
    @Basic(optional = false)
    @Column(name = "partido1")
    private int partido1;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;

    public RankingFifa() {
    }

    public RankingFifa(Integer id) {
        this.id = id;
    }

    public RankingFifa(Integer id, String ranking, String grupo, String copas, String partido3, String partido2, int partido1, String nombre) {
        this.id = id;
        this.ranking = ranking;
        this.grupo = grupo;
        this.copas = copas;
        this.partido3 = partido3;
        this.partido2 = partido2;
        this.partido1 = partido1;
        this.nombre = nombre;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getRanking() {
        return ranking;
    }

    public void setRanking(String ranking) {
        String oldRanking = this.ranking;
        this.ranking = ranking;
        changeSupport.firePropertyChange("ranking", oldRanking, ranking);
    }

    public String getGrupo() {
        return grupo;
    }

    public void setGrupo(String grupo) {
        String oldGrupo = this.grupo;
        this.grupo = grupo;
        changeSupport.firePropertyChange("grupo", oldGrupo, grupo);
    }

    public String getCopas() {
        return copas;
    }

    public void setCopas(String copas) {
        String oldCopas = this.copas;
        this.copas = copas;
        changeSupport.firePropertyChange("copas", oldCopas, copas);
    }

    public String getPartido3() {
        return partido3;
    }

    public void setPartido3(String partido3) {
        String oldPartido3 = this.partido3;
        this.partido3 = partido3;
        changeSupport.firePropertyChange("partido3", oldPartido3, partido3);
    }

    public String getPartido2() {
        return partido2;
    }

    public void setPartido2(String partido2) {
        String oldPartido2 = this.partido2;
        this.partido2 = partido2;
        changeSupport.firePropertyChange("partido2", oldPartido2, partido2);
    }

    public int getPartido1() {
        return partido1;
    }

    public void setPartido1(int partido1) {
        int oldPartido1 = this.partido1;
        this.partido1 = partido1;
        changeSupport.firePropertyChange("partido1", oldPartido1, partido1);
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        String oldNombre = this.nombre;
        this.nombre = nombre;
        changeSupport.firePropertyChange("nombre", oldNombre, nombre);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RankingFifa)) {
            return false;
        }
        RankingFifa other = (RankingFifa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mundial.RankingFifa[ nombre=" + nombre + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
